package cfdt.common.logging;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class FeignInfoLogger extends feign.Logger {

    private final Logger logger;

    public FeignInfoLogger() {
        this(feign.Logger.class);
    }

    public FeignInfoLogger(Class<?> clazz) {
        this(LoggerFactory.getLogger(clazz));
    }

    public FeignInfoLogger(String name) {
        this(LoggerFactory.getLogger(name));
    }

    public FeignInfoLogger(Logger logger) {
        this.logger = logger;
    }

    @Override
    protected void log(String configKey, String format, Object... args) {
        logger.info(String.format(methodTag(configKey) + format, args));
    }

}
